unit fCheckProductReport;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters,
  cxStyles, dxSkinsCore, dxSkinCaramel, dxSkinOffice2010Silver, dxSkinSeven,
  dxSkinscxPCPainter, cxCustomData, cxFilter, cxData, cxDataStorage, cxEdit, DB,
  cxDBData, Menus, cxContainer, cxLabel, StdCtrls, cxButtons, cxGridLevel,
  cxClasses, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
  cxGridDBTableView, cxGrid, fClientDataModule, uDAScriptingProvider,
  uDADataTable, uDAMemDataTable, uDAInterfaces, uDARemoteDataAdapter;

type
  TfmCheckProductReport = class(TForm)
    tvProduct: TcxGridDBTableView;
    lvProduct: TcxGridLevel;
    grdProduct: TcxGrid;
    cxButton1: TcxButton;
    cxButton2: TcxButton;
    cxLabel2: TcxLabel;
    tvProductColumn1: TcxGridDBColumn;
    tvProductColumn2: TcxGridDBColumn;
    tvProductColumn3: TcxGridDBColumn;
    tvProductColumn4: TcxGridDBColumn;
    dsBrowser: TDADataSource;
    tblBrowser: TDAMemDataTable;
    rdaBrowser: TDARemoteDataAdapter;
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    Realno: string;
  end;

var
  fmCheckProductReport: TfmCheckProductReport;

implementation

{$R *.dfm}

procedure TfmCheckProductReport.FormShow(Sender: TObject);
var
  sql: string;
begin
  sql := 'select bpi_no,bpi_realno,bpi_fid,bpi_cname from b_productinfo where bpi_realno like '+ QuotedStr('%'+Realno+'%') + ' and len(bpi_realno)*3/4<'+IntToStr(Length(Realno));
  rdaBrowser.GetDataCall.ParamByName('aSQLText').AsString := AnsiToUtf8(sql);
  tblBrowser.MaxRecords := -1;
  rdaBrowser.Fill([tblBrowser], true, true);
end;

end.
